home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / dfpp01.zip / DESKTOP.CPP < prev    next >
C/C++ Source or Header  |  1992-11-21  |  656b  |  46 lines

  1. // --------------- desktop.cpp
  2.  
  3. #include <new.h>
  4. #include "desktop.h"
  5.  
  6. DeskTop desktop;
  7.  
  8. #ifdef MSC
  9. int NoMemory(unsigned int)
  10. {
  11.     exit(-1);
  12.     return 0;
  13. }
  14. #else
  15. void NoMemory()
  16. {
  17.     exit(-1);
  18. }
  19. #endif
  20.  
  21. DeskTop::DeskTop()
  22. {
  23.     apwnd = infocus = firstcapture = focuscapture = NULL;
  24. #ifdef MSC
  25.     _set_new_handler(&NoMemory);
  26. #else
  27.     set_new_handler(NoMemory);
  28. #endif
  29.     syscursor.Hide();
  30. }
  31.  
  32. DeskTop::~DeskTop()
  33. {
  34.     syscursor.Show();
  35. }
  36.  
  37. Bool DeskTop::DispatchEvents()
  38. {
  39.     syskeyboard.DispatchEvent();
  40.     sysmouse.DispatchEvent();
  41.     sysclock.DispatchEvent();
  42.     return (Bool) (apwnd != NULL);
  43. }
  44.  
  45.  
  46.